<%@page import="java.util.List"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page" %>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" href="<c:url value='/resources/style/st-pop.css' />" type="text/css" />
	<link href="<c:url value="/resources/jqueryui/1.8/themes/base/jquery.ui.all.css" />" rel="stylesheet" type="text/css"/>
	<link rel="stylesheet" href="<c:url value='/resources/jMenu/css/jmenu.css' />" type="text/css" />
	<link rel="stylesheet" href="<c:url value='/resources/style/common.css' />" type="text/css" />
	<link rel="stylesheet" href="<c:url value='/resources/jqueryzTree/css/zTreeStyle/zTreeStyle.css' />" type="text/css" />
	<link rel="stylesheet" href="<c:url value='/resources/pagination/css/style.css' />" type="text/css" />
	<script type="text/javascript" src="<c:url value="/resources/jquery/1.6/jquery.js" />"></script>
	<script type="text/javascript" src="<c:url value="/resources/jqueryform/2.8/jquery.form.js" />"></script>
	<script type="text/javascript" src="<c:url value="/resources/jqueryui/1.8/jquery.ui.core.js" />"></script>
	<script type="text/javascript" src="<c:url value="/resources/jqueryui/1.8/jquery.ui.widget.js" />"></script>
	<script type="text/javascript" src="<c:url value="/resources/jqueryui/1.8/jquery.ui.tabs.js" />"></script>
	<script type="text/javascript" src="<c:url value="/resources/json2.js" />"></script>
	<script type="text/javascript" src="<c:url value="/resources/jMenu/js/jMenu.jquery.js" />"></script>
	<script type="text/javascript" src="<c:url value="/resources/My97DatePicker/WdatePicker.js" />"></script>
	<script type="text/javascript" src="<c:url value="/resources/jqueryzTree/js/jquery.ztree.core-3.5.js" />"></script>
	<script type="text/javascript" src="<c:url value="/resources/jqueryzTree/js/jquery.ztree.excheck-3.5.js"/>"></script>
	<script type="text/javascript" src="<c:url value="/resources/lightbox/jquery.lightbox_me.js" />"></script>
	<script language="javascript" src="<c:url value='/resources/pagination/jquery.paginate.js' />"></script>
	<script language="javascript" src="<c:url value='/resources/common/selectTree.js' />"></script>
	<script language="javascript" src="<c:url value='/resources/highcharts/highcharts.js' />"></script>
	<link href="<c:url value="/resources/form.css" />" rel="stylesheet"  type="text/css" />		
<title><decorator:title default="cms" /></title>
<decorator:head />
<style type="text/css" media="screen">
<!--
.ccc{ width:150px; position:absolute; left:0; background:Blue;}
.ddd{ width:150px; position:absolute; top:100%;right:0; margin-top:-20px; background:Blue;}
-->
</style>
<script type="text/javascript">
	var isRow = true;
</script>
<style type="text/css">
	.cleanLi{
		width:0.1px !important;
		background-color:#000000 !important
	}
</style>
</head>
<body style="align:left">
<%
	String menuId = (String)request.getSession().getAttribute("menuId");
%>
<div align="center" >
<div>
	 <img src="<c:url value="/resources/images/header.jpg" />" style="width:100%;height:160px;" />
	 <div style="position:absolute; z-index:2; left:70%; top:20px">
　　<a id ="setHome" style="text-decoration:none;" onclick="SetHome(window.location)" href="javascript:void(0)"><font color="#FFFFFF" size="4" style="font-weight:bold;">设为首页&nbsp;&nbsp;</font></a>
		<a id ="addFavorite"  style="text-decoration:none;" onclick="AddFavorite(window.location,document.title)" href="javascript:void(0)"><font color="#FFFFFF" size="4" style="font-weight:bold;">收藏网站&nbsp;&nbsp;</font></a>
		<a id ="changePassword"  style="text-decoration:none;" onclick="changePwd()" href="javascript:void(0)"><font color="#FFFFFF" size="4" style="font-weight:bold;">更改密码&nbsp;&nbsp;</font></a>
		<c:url value="/j_spring_security_logout" var="logoutUrl"></c:url>
		<a  id ="logIn" style="text-decoration:none;" href="${logoutUrl}"><font color="#FFFFFF" size="4" style="font-weight:bold;">注销&nbsp;&nbsp;</font></a>
</div>
	<div  style="position:absolute; z-index:2; left:2px; top:150px">
		  <font id="warringGuest"  color="#FFFFFF" size="4" style="font-weight:bold;">管理员,您好! 欢迎访问</font>	
	</div>
</div>
<ul id="jMenu" style="width:100%">
           <li id="personPT">
                <a  id="个人平台">个人平台</a>
            </li>	
            <li id="个人平台1" class=cleanLi></li>
            <li id = "shujushangbaoGuest">
            	<a href="${pageContext.request.contextPath}/patient/findAll"  id="数据上报">病人管理</a>
            </li>
        </ul>
</div>
 <div id="popDivPWD" style="width:450px;display:none">
<form id="formPWD" name="formPWD" action="" method="post">
 	<table cellspacing="0" style="width:95%" >
 		<tr>
 			<th id="titlePWD" colspan="2">更改密码</th>
 		</tr>
 		<tr>
 			<td>原密码</td>
 			<td><input type="password" id="pwd" name="pwd" style="width:270px;" /><font style="color: red">★</font>
 		</tr>
 		<tr>
 			<td>新密码</td>
 			<td><input type="password" id="newPwd" name="newPwd" style="width:270px;" /><font style="color: red">★</font>
 		</tr>
 		<tr>
 			<td>再次输入新密码</td>
 			<td><input type="password" id="newPwdMore" name="newPwdMore" style="width:270px;" /><font style="color: red">★</font>
 		</tr>
 		<tr>
 			<td colspan="2" align="center">
 			<input id="savePWD" type="button" value="确 定" onclick="savePwd()"/>
 			<input type="button" value="取 消" onclick="closePWD()"/></td>
 		</tr>
 	</table>
</form>
</div>
<div>
	<table width="100%">
		<tr>
			<td width="10%" align="center"><font color="#0053CF">滚动播报</font></td>
			<td width="90%"><marquee
			aligh=left
			bgcolor=#ffffff
			direction=left
			behavior=scroll
			loop＝n><font color="#0053CF" id="gundong"></font></marquee></td>
		</tr>
	</table>
</div>
</br><decorator:body/>
<div id="bottomInfo" style="display:block;left:7px;width:99.4%"  class="ccc">
<table id="mytable" width="100%" cellspacing="0">  
  <tr>
    <th width="18%">榆林市发展和改革委员会</th> 
    <th width="7%">现在时间</th>
    <th width="20%" id="nowTime"></th>
    <th width="5%">部门</th>
    <th width="10%" id="deptName"></th>
    <th width="7%">操作员</th>
    <th width="10%" id="userName"></th>
    <th width="5%"></th>
    <th width="10%"></th>
  </tr> 
</table> 
</div>
<script type="text/javascript">
var menuStr = "个人平台,待办事宜,政策文件,指标上报,数据上报,数据导入,县区计划导入,指标采集,数据采集,全国重点采集,周边指标采集,省内地市指标采集,统计分析,数据催报,历史数据,历史上报,数据查询,采集数据查询,上报数据查询,地区数据查询,指标排序,地方排序,周边排序,省内排序,指标发布,手机发布,指标管理,数据库维护,目录维护,表格维护,指标维护,指标类别维护,模板管理,上报模板维护,系统管理,系统初始化,企业维护,角色维护,权限维护,资源维护,人员维护,数据字典,滚动播报,系统日志,综合指标汇总,上报统计,部门维护,采集分析,采集上报,数据上报,数据审核";
var ctx = "${pageContext.request.contextPath}";
var allRights;
//查询所有权限	
$.ajax( {
		type : 'GET',
		url :"${pageContext.request.contextPath}/ufmUser/hasRight",
		cache : false,
		async:false,
		error : function(XMLHttpRequest, textStatus, errorThrown) {
			//alert(XMLHttpRequest.readyState);
		},
		success : function(data) {
			initAllLi();
			allRights = eval(data);
			setAllLi(allRights);
			$("#jMenu").jMenu({
		        openClick : false,
		        ulWidth :'auto',
		         TimeBeforeOpening : 100,
		        TimeBeforeClosing : 11,
		        animatedText : false,
		        paddingLeft: 1,
		        effects : {
		            effectSpeedOpen : 150,
		            effectSpeedClose : 150,
		            effectTypeOpen : 'slide',
		            effectTypeClose : 'slide',
		            effectOpen : 'swing',
		            effectClose : 'swing'
		        }
		    });
		}
	});
	
	//给点击过的菜单改变颜色
	var menuId = '<%=menuId%>';
	if(menuId != "null"){
		$("#"+menuId).css("background-color","#1573FF");
	}
	
	//将点击的菜单的MenuId放在session中
	$("a[alt=menu]").click(function(){
		if($(this).attr("name") != null){
			var url = "${pageContext.request.contextPath}/ufmUser/changeMenu";
			//$(this).css("background-color","#000000");
			$.ajax( {
				type : 'POST',
				url : url,
				data:{MenuId:$(this).attr("name")},
				cache : false,
				async:false,
				error : function(XMLHttpRequest, textStatus, errorThrown) {
					//alert(XMLHttpRequest.readyState);
				},
				success : function(data) {
				}
			});
			
		}
	});
function initAllLi(){
	var arrayObj = new Array();
	arrayObj=menuStr.split(",");
	for(var i=0;i<arrayObj.length;i++){
		var id ="#"+arrayObj[i];
		$("#"+arrayObj[i]).css("display","none");
		$("#"+arrayObj[i]).parent().css("border",0);
		$("#"+arrayObj[i]+"1").css("display","none");
	}
}
function setAllLi(allRights){
	var arrayObj = allRights;
	for(var i=0;i<arrayObj.length;i++){
		$("#"+arrayObj[i]).css("display","block");
		$("#"+arrayObj[i]).parent().css("border-bottom","1px solid #484548");
		$("#"+arrayObj[i]+"1").css("display","");
		
	}
}
if(document.body.clientHeight>759){
	$("#bottomInfo").css("margin-bottom","0px");
}else{
	if(document.body.clientHeight<759 && document.body.clientHeight>380){
		var heightBottom = 500-(document.body.clientHeight-228);
	}else if(document.body.clientHeight<300){
		if(document.getElementById("maincontent")!=null){
			$("#bottomInfo").css("margin-bottom","0px");
		}else{
			var heightBottom = 500-(document.body.clientHeight-298);
		}
	}else{
		var heightBottom = 500-(document.body.clientHeight-260);
	}
	$("#bottomInfo").css("margin-top",heightBottom);
}
function AddFavorite(sURL, sTitle) {
	 
    sURL = encodeURI(sURL); 
try{   

    window.external.addFavorite(sURL, sTitle);   

}catch(e) {   

    try{   

        window.sidebar.addPanel(sTitle, sURL, "");   

    }catch (e) {   

        alert("加入收藏失败，请使用Ctrl+D进行添加,或手动在浏览器里进行设置.");

    }   

}

}

//设为首页

function SetHome(url){

if (document.all) {

    document.body.style.behavior='url(#default#homepage)';

       document.body.setHomePage(url);

}else{

    alert("您好,您的浏览器不支持自动设置页面为首页功能,请您手动在浏览器里设置该页面为首页!");

}

}

/*
$.ajax( {
	type : 'GET',
	url :"${pageContext.request.contextPath}/ufmUser/getGunDongBoBao",
	cache : false,
	async:false,
	error : function(XMLHttpRequest, textStatus, errorThrown) {
		//alert(XMLHttpRequest.readyState);
	},
	success : function(data) {
		if(data.getGunDongBoBao != null){
			document.getElementById("gundong").innerText=data.getGunDongBoBao;
		}
	}
});
*/

function setTime(){
	var time = new Date();
	var nowTime = time.getFullYear()+"年"+(time.getMonth()+1)+"月"+time.getDate()+"日"+" "+time.getHours()+"时"+time.getMinutes()+"分"+time.getSeconds()+"秒";
	document.getElementById("nowTime").innerText=nowTime;
}
setInterval("setTime()",1000);
function changePwd(){
	var width = document.body.clientWidth/2;
	var height = document.body.clientHeight/2;
	jQuery('#popDivPWD').lightbox_me({
		modalCSS:{top: height,left:width},
	 });
}
function closePWD(){
	jQuery('#popDivPWD').trigger("close");
}
function savePwd(){
	if($("#pwd").val() == ""){
		alert("请输入原密码");
		return ;
	}
	if($("#newPwd").val() == ""){
		alert("请输入新密码");
		return ;
	}
	if($("#newPwdMore").val() == ""){
		alert("请再次输入密码");
		return ;
	}
	if($("#newPwd").val() != $("#newPwdMore").val()){
		alert("两次输入密码不一致，请重新输入");
		return ;
	}
	$.ajax( {
		type : 'GET',
		url :"${pageContext.request.contextPath}/ufmUser/changePwd?pwd="+$("#pwd").val()+"&newPwd="+$("#newPwd").val(),
		cache : false,
		async:false,
		error : function(XMLHttpRequest, textStatus, errorThrown) {
			//alert(XMLHttpRequest.readyState);
		},
		success : function(data) {
			if(data == "0"){
				alert("输入的原密码不正确");
			}else{
				alert("修改成功");
				jQuery('#popDivPWD').trigger("close");
			}
		}
	});
}
</script>
</body>
</html>